package com.unsins.business.jms;

import javax.jms.TextMessage;

/**
 * Created by IntelliJ IDEA.
 * User: odpsoft
 * Date: 2008-12-2
 * Time: 16:53:46
 */
public class JmsConsumer implements javax.jms.MessageListener {
    private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(JmsConsumer.class);

    public void onMessage(javax.jms.Message message) {
        try {
            message.acknowledge();
            LOG.info(((TextMessage) message).getText()+":JMS");
            LOG.info(((TextMessage) message).getStringProperty("next")+":JMS");
        } catch (javax.jms.JMSException e) {
            LOG.error("Failed to acknowledge: " + e, e);
        }
    }
}
